package dfbz.homework1;

public class Test04 {
    public static void main(String[] args) {
        String str = "HelloWorld";
        char[] ch=str.toCharArray();
//        String str1= Arrays.toString(ch);
//        System.out.println(str1);
        for (int i = 0; i < ch.length; i++) {
            System.out.println(ch[i]);
        }
        /*1. 将str字符串转换为字符数组,并遍历字符数组,输出每个字符
          2. 将str字符串转换为小写并打印
          3. 将str字符串转换为大写并打印
          4. 将str字符串中的字符'o'替换成'6'并打印
          5. 将str字符串中的字符串"ll"替换成"LL"并打印
        * */
        String str1=str.toUpperCase();
        String str2=str.toLowerCase();
        String str3=str.replace("o","6");
        String str4=str.replace("ll","LL");
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);
        System.out.println(str4);

    }
}
